unit UFrmEmpresa;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  DBCtrls, StdCtrls, Mask, ExtCtrls, ExtDlgs, Buttons;

type
  TFrmempresa = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    DBEdit1: TDBEdit;
    Label2: TLabel;
    DBEdit2: TDBEdit;
    Label3: TLabel;
    DBEdit3: TDBEdit;
    GroupBox2: TGroupBox;
    Label4: TLabel;
    DBEdit4: TDBEdit;
    Label5: TLabel;
    DBEdit5: TDBEdit;
    Label6: TLabel;
    DBComboBox1: TDBComboBox;
    GroupBox3: TGroupBox;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    DBEdit7: TDBEdit;
    DBEdit8: TDBEdit;
    DBEdit9: TDBEdit;
    DBEdit10: TDBEdit;
    OpenPictureDialog1: TOpenPictureDialog;
    Panel1: TPanel;
    Label11: TLabel;
    Image1: TImage;
    BitBtn1: TBitBtn;
    Panel2: TPanel;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    BitBtn4: TBitBtn;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    Label20: TLabel;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Image2: TImage;
    procedure BitBtn1Click(Sender: TObject);
    procedure Label13MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure Panel2MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure GroupBox3MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label14MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label15MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label16MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label17MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label20MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label19MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label18MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure GroupBox2MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label22MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label21MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label23MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure GroupBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frmempresa: TFrmempresa;

implementation

uses Modulo;

{$R *.DFM}

procedure TFrmempresa.BitBtn1Click(Sender: TObject);
begin
  DMEscola.Tempresa.Edit;
  if OpenPictureDialog1.Execute then
  begin
   Image2.Picture.LoadFromFile(OpenPictureDialog1.Filename);
   Image2.Visible:=True;
   DMescola.TempresaLogo.Value:=OpenPictureDialog1.Filename;
  end
end;

procedure TFrmempresa.Label13MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
    Label12.visible := true;
end;

procedure TFrmempresa.BitBtn2Click(Sender: TObject);
begin
   DMEscola.Tempresa.Post;
   DMEscola.Tempresa.edit;
end;

procedure TFrmempresa.BitBtn3Click(Sender: TObject);
begin
   DMEscola.Tempresa.Edit;
end;

procedure TFrmempresa.BitBtn4Click(Sender: TObject);
begin
   Close;
end;

procedure TFrmempresa.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   Action := CaFree;
end;

procedure TFrmempresa.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
   if MessageDlg('        Deseja realmente encerrar'+#13+'Cadastro de informações da Empresa?',MtConfirmation,[mbyes, mbno],0) = mrno then
      Canclose := false;
end;

procedure TFrmempresa.Panel2MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   Label12.Visible := false;
end;

procedure TFrmempresa.GroupBox3MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
begin
   Label7.visible := false;
   label8.visible := false;
   label9.visible := false;
   label10.visible := false;
end;

procedure TFrmempresa.Label14MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label8.visible := true;
end;

procedure TFrmempresa.Label15MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label9.visible := true;
end;

procedure TFrmempresa.Label16MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label7.visible := true;
end;

procedure TFrmempresa.Label17MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label10.visible := true;
end;

procedure TFrmempresa.Label20MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label4.visible := true;
end;

procedure TFrmempresa.Label19MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label5.visible := true;
end;

procedure TFrmempresa.Label18MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label6.visible := true;
end;

procedure TFrmempresa.GroupBox2MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
begin
   label4.visible := false;
   label5.visible := false;
   label6.visible := false;
end;

procedure TFrmempresa.Label22MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label1.visible := true;
end;

procedure TFrmempresa.Label21MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label2.visible := true;
end;

procedure TFrmempresa.Label23MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
   label3.visible := true;
end;

procedure TFrmempresa.GroupBox1MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
begin
   label1.visible := false;
   label2.visible := false;
   label3.visible := false;
end;

procedure TFrmempresa.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
   if Key = VK_F7 then
      BitBtn2.Click;
   if Key = VK_F8 then
      BitBtn3.Click;
   if Key = VK_F12 then
      BitBtn4.Click;
end;

procedure TFrmempresa.FormShow(Sender: TObject);
begin
   DMEscola.Tempresa.Edit;
   OpenPictureDialog1.Filename := DMescola.TempresaLogo.Value;
   Image2.Picture.LoadFromFile(OpenPictureDialog1.Filename);
   Image2.Visible:=True;
end;

end.
